package com.jhsw.roadsun.module.business.dal.mysql.expressagegoods;

import java.util.*;

import com.jhsw.roadsun.framework.common.pojo.PageResult;
import com.jhsw.roadsun.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.jhsw.roadsun.framework.mybatis.core.mapper.BaseMapperX;
import com.jhsw.roadsun.module.business.dal.dataobject.expressagegoods.ExpressageGoodsDO;
import org.apache.ibatis.annotations.Mapper;
import com.jhsw.roadsun.module.business.controller.admin.expressagegoods.vo.*;

/**
 * 寄件货物信息 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface ExpressageGoodsMapper extends BaseMapperX<ExpressageGoodsDO> {

    default PageResult<ExpressageGoodsDO> selectPage(ExpressageGoodsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpressageGoodsDO>()
                .eqIfPresent(ExpressageGoodsDO::getExpressageId, reqVO.getExpressageId())
                .likeIfPresent(ExpressageGoodsDO::getName, reqVO.getName())
                .eqIfPresent(ExpressageGoodsDO::getUnitPrice, reqVO.getUnitPrice())
                .eqIfPresent(ExpressageGoodsDO::getNum, reqVO.getNum())
                .eqIfPresent(ExpressageGoodsDO::getTotalPrice, reqVO.getTotalPrice())
                .betweenIfPresent(ExpressageGoodsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExpressageGoodsDO::getId));
    }

}